Skip to content

[feat] Add codeExecutor.env and codeExecutor.environmentVariables - #430

Open
cameronattard wants to merge 1 commit into
tryretool:mainfrom
cameronattard:feat/code-executor-env
Open

cameronattard wants to merge 1 commit into
tryretool:mainfrom
cameronattard:feat/code-executor-env

Conversation

@cameronattard

Copy link
Copy Markdown

What

Adds codeExecutor.env (map, same format as the top-level env) and codeExecutor.environmentVariables (list, valueFrom supported). They render after the shared top-level env / environmentSecrets / environmentVariables, so a name set in both takes the code-executor value.

Why

Some settings are read only by the code executor, such as options for its sandbox. Today the only way to set them is the top-level env, which puts them on every Retool pod.

The JS executor already has its own env / environmentVariables (not inherited). For the code executor this PR keeps inheriting the shared environment and adds the new values on top, so existing installs render identically.

Verified

  • New .github/test_code_executor_env.py, wired into ci.yaml, checks four things:
    • map and list entries reach the code executor but not the backend;
    • the code-executor value comes after the shared one;
    • the defaults add nothing.
  • helm lint and schema/generate.sh --check pass; the two values.yaml files are in sync.
  • New charts/retool/ci/test-code-executor-env-option.yaml, so kubeconform validates the new path (passes locally with kubeconform 0.6.7 against Kubernetes 1.31.1).
  • Chart version bump 6.14.2 -> 6.14.3.

@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change reaches environment configuration for the code-executor workload.

The PR appears safe to merge, with a non-blocking request to test secret-backed entries directly.

Findings

  1. P2 Secret-backed entries go untested ▶

Reviews (1) · Last reviewed commit: "[feat] Add codeExecutor.env and codeExec..." · Reviewed by Greptile

Comment on lines +40 to +44
def test_list_env_reaches_the_code_executor(self):
out = render("codeExecutor.environmentVariables[0].name=CE_ONLY",
"codeExecutor.environmentVariables[0].value=1")
self.assertIn("CE_ONLY", env_names(out, "deployment_code_executor.yaml"))
self.assertNotIn("CE_ONLY", env_names(out, "deployment_backend.yaml"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Secret-backed entries go untested

The new list test checks only the variable's name. It never supplies or checks valueFrom, although secret-backed entries are part of this feature. The CI fixture includes one, but its schema check would still pass if the template dropped the entry entirely.

Add a render assertion for the full valueFrom.secretKeyRef entry and confirm it stays out of the backend. This is non-blocking test coverage feedback.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 5c8665f: test_secret_backed_list_entry_renders_in_full asserts the full valueFrom.secretKeyRef entry on the code executor and that it stays off the backend. It fails if the template drops the list.

Settings only the code executor reads could only be set through the
top-level env, which every Retool pod receives. The code executor now also
takes its own env (map) and environmentVariables (list), rendered after the
shared ones so they take precedence. The shared env is still inherited, so
existing installs are unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant